package com.atguigu.paymentdemo.util;

import java.security.MessageDigest;

public class MD5Util {

    public static final String ECB_KEY = "F4obtZno{_8kMXvE";

    public static String MD5(String s) {
        char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

        try {
            byte[] e = s.getBytes();
            MessageDigest mdInst = MessageDigest.getInstance("MD5");
            mdInst.update(e);
            byte[] md = mdInst.digest();
            int j = md.length;
            char[] str = new char[j * 2];
            int k = 0;

            for (byte byte0 : md) {
                str[k++] = hexDigits[byte0 >>> 4 & 15];
                str[k++] = hexDigits[byte0 & 15];
            }

            return new String(str).toLowerCase();
        } catch (Exception var10) {
            var10.printStackTrace();
            return null;
        }
    }

}